import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
import 'package:whale/pages/me/msg/cell.dart';

import '../../../helper/utils/util.dart';
import 'logic.dart';

class MsgPage extends StatelessWidget {
  MsgPage({Key? key}) : super(key: key);

  final logic = Get.put(MsgLogic());
  final state = Get.find<MsgLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: detailAppBar(context, title: '消息中心', actions: [
        IconButton(
          onPressed: () {},
          icon: loadImage(url: 'clean.png'.imgPathMeans, width: 18.r),
        ),
      ]),
      body: SmartRefresher(
        onRefresh: logic.onRefresh,
        onLoading: logic.onLoading,
        enablePullUp: true,
        controller: state.rc,
        child: ListView.builder(
          itemBuilder: (context, index) {
            return SysMsgCell();
          },
          itemCount: 5,
        ),
      ),
    );
  }
}
